package com.ljd.excel;

import com.alibaba.excel.EasyExcel;

import java.util.ArrayList;
import java.util.List;


public class SubjectExcelWrite {
    public static void main(String[] args) {
        String pathName = "D:/1.xlsx";
        EasyExcel.write(pathName,Subject.class).sheet("课程分类").doWrite(data());
    }
    public static List<Subject> data(){
        List<Subject> subjects = new ArrayList<>();
        Subject subject = new Subject();
        subject.setOneSubjectName("后端");
        subject.setTwoSubjectName("nginx");
        Subject subject1 = new Subject();
        subject.setOneSubjectName("后端");
        subject.setTwoSubjectName("redis");
        subjects.add(subject);
        subjects.add(subject1);
        return subjects;

    }
}
